﻿<%@ Page UICulture="vi" Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MainAdmin.Master"
    CodeBehind="AdminAddBook.aspx.vb" Inherits="QLThuVien.AddBook" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
     function hide() {
            var seconds = 4;
            setTimeout(function () {
                document.getElementById('successDiv').style.display = "none";
            }, seconds * 1000);
        }
        function loadingPanel(s, e) {
            lp_loadingall.Show();
        }
        function showImgAfterUpload(s, e) {
           
                img_sach.SetImageUrl("img/book/" + e.callbackData);
           
        }  
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                             <ContentTemplate>   
    <div class="row">
        <div class="col-md-12">
            <h1 class="page-header">
                Thêm Sách
            </h1>
        </div>
    </div>
    <div class="row" id="container">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-6">
                            <div class="form-group">
                                <label>
                                    Mã Sách</label>
        
                                <dx:ASPxTextBox ID="tb_masach" runat="server"  CssClass="form-control" NullText="Nhập mã sách..." Width="100%">
                                    <ValidationSettings SetFocusOnError="true" ErrorTextPosition="Bottom">
                                        <RequiredField IsRequired="true" ErrorText="Chưa Nhập Mã Sách" />
                          
                                    </ValidationSettings>
                                 
                                    
                                </dx:ASPxTextBox>
                            </div>
                            <div class="form-group">
                                <label>
                                    Tên Sách</label>
                               <dx:ASPxTextBox
                                    ID="tb_tensach" runat="server"  CssClass="form-control" NullText="Nhập tên sách..." Width="100%">
                                    <ValidationSettings SetFocusOnError="true" ErrorTextPosition="Bottom">
                                        <RequiredField IsRequired="true" ErrorText="Chưa Nhập Tên Sách" />
                          
                                    </ValidationSettings>
                                </dx:ASPxTextBox>
                            </div>
                            <div class="form-group">
                                <label>
                                    Mô Tả Chi Tiết
                                </label>
                                <dx:ASPxMemo ID="tb_chitiet" runat="server"  Width="100%" NullText="Nhập mô tả chi tiết..." Height="100px" CssClass="form-control">
                            
                                </dx:ASPxMemo>
                            </div>
                            <div class="form-group">
                                <label>
                                    Tác Giả
                                </label>
                                <dx:ASPxTextBox
                                    ID="tb_tacgia" runat="server"  CssClass="form-control" NullText="Nhập tác giả...">
                                </dx:ASPxTextBox>
                            </div>
                            <div class="form-group">
                                <label>
                                    Nhà Xuất Bản
                                </label>
                              <dx:ASPxTextBox
                                    ID="tb_nxb" runat="server"  CssClass="form-control" NullText="Nhập nhà xuất bản...">
                                </dx:ASPxTextBox>
                            </div>
                
                            <div class="form-group">
                                <label>
                                    Số Lượng
                                </label>
        
                                <dx:ASPxSpinEdit ID="sp_soluong" runat="server" Number="1" MinValue="1" MaxValue="100" CssClass="form-control">
                                </dx:ASPxSpinEdit>
                            </div>
                              
                        </div>
                        <!-- /.col-lg-6 (nested) -->
                        
                                  
                        <div class="col-lg-6">
                                         
                          
                                                
                            <div class="form-group">
                                <label>Danh Mục - Phân Loại</label>
         
                                <dx:ASPxComboBox ID="cb_danhmuc" runat="server" ValueType="System.String" AutoPostBack="True" TextField="tendm" ValueField="id" CssClass="form-control" NullText="Chọn Danh Mục..." >
         
                                <ValidationSettings SetFocusOnError="true" ErrorTextPosition="Bottom" >
                                 <RequiredField IsRequired="true" ErrorText="Chưa Chọn Danh Mục"/>  
                                </ValidationSettings>
                                <ClientSideEvents SelectedIndexChanged="loadingPanel" />
                                </dx:ASPxComboBox>
                                <dx:ASPxRadioButtonList ID="rdbtn_phanloai" runat="server" Visible="false" SelectedIndex="0"
                                    ValueType="System.String"  CssClass="radio" Theme="MetropolisBlue" Caption="Chọn Phân Loại" CaptionSettings-Position="Top" Border-BorderStyle="None"  CaptionStyle-ForeColor="DarkBlue">
                                </dx:ASPxRadioButtonList>
                                
                            </div>
                            <div class="form-group">
                                <label>Vị Trí</label>
                                <dx:ASPxComboBox ID="cb_ke" runat="server" ValueType="System.String" TextField="ke" ValueField="ke" CssClass="form-control"  AutoPostBack="true" NullText="Chọn Vị Trí..." >
                                 <ClientSideEvents SelectedIndexChanged="loadingPanel" />
                                <ValidationSettings SetFocusOnError="true" ErrorTextPosition="Bottom" >
                                   <RequiredField IsRequired="true" ErrorText="Chưa Chọn Kệ" />  
                                </ValidationSettings>
                                </dx:ASPxComboBox>
                                <dx:ASPxRadioButtonList ID="rdbtn_hang" runat="server" ValueType="System.String" Visible="false" 
                                     CssClass="radio" Theme="MetropolisBlue" Caption="Chọn Hàng" CaptionSettings-Position="Top" Border-BorderStyle="None"  CaptionStyle-ForeColor="DarkBlue" SelectedIndex="0"  >
                                     <Items>
                                        <dx:ListEditItem Text="Hàng 1" Value="H-1"   />
                                        <dx:ListEditItem Text="Hàng 2" Value="H-2" />
                                        <dx:ListEditItem Text="Hàng 3" Value="H-3" />
                                        <dx:ListEditItem Text="Hàng 4" Value="H-4" />
                                        <dx:ListEditItem Text="Hàng 5" Value="H-5" />
                                     </Items>
                                </dx:ASPxRadioButtonList>                
                            </div>
                                <div class="form-group">
                                <label>
                                    Hình Ảnh</label>
                                   <b> <dx:ASPxImage ID="img_sach" ClientInstanceName="img_sach"  runat="server" ShowLoadingImage="true" Width="100%" Height="350px" EmptyImage-Url="~/img/no-thumbnail.png" >
                                    </dx:ASPxImage>
                                    </b>
                                      
                            </div> 
                            <div class="form-group">
                                <dx:ASPxUploadControl ID="upload_sach" runat="server" UploadMode="Auto" Width="100%" ShowUploadButton="true" ShowProgressPanel="true" BrowseButton-Text="Chọn Hình..." NullText="Chấp Nhận .JPG, .GIF hoặc .PNG" >
                                <UploadButton Image-IconID="navigation_up_16x16office2013" ></UploadButton>
                                <ValidationSettings AllowedFileExtensions=".jpg, .jpeg, .gif ,.png"  ShowErrors="true">
                                </ValidationSettings> 
                                <ClientSideEvents FileUploadComplete="showImgAfterUpload" /> 
                                    </dx:ASPxUploadControl>
                                </div>   
                            <div class="form-group">
                                <dx:ASPxButton ID="bt_them" runat="server" Text="Xác Nhận" CssClass="btn btn-primary" ClientIDMode="Static">
                                <ClientSideEvents Click="function(s,e){hide()}"  /> 
                                </dx:ASPxButton>
                                <dx:ASPxButton ID="bt_hoantac" runat="server" Text="Hoàn Tác" CssClass="btn btn-danger">
                                </dx:ASPxButton>
                                
                            </div>
                             <div class="alert alert-success" runat="server" id="successDiv" visible="false" clientidmode="Static">
                                                            <dx:ASPxLabel ID="lb_mess" runat="server" Font-Bold="true">
                                                            </dx:ASPxLabel>
                             </div>     
                             
                        </div>
                           
                        <!-- /.col-lg-6 (nested) -->
                    </div>
                    <!-- /.row (nested) -->
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
        <!-- /.col-lg-12 -->
    </div>
                                 <dx:ASPxLoadingPanel ID="lp_loadingall" runat="server" Modal="true" ClientInstanceName="lp_loadingall" ContainerElementID="container"  >
                                 </dx:ASPxLoadingPanel>
    <div>
       
    </div>
    <div>
    </div> 
  </ContentTemplate>
   
</asp:UpdatePanel> 
</asp:Content>
